package cn.wizzer.app.user.modules.models.enums;

import lombok.Getter;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Getter
public enum GoodsCategoryEnum {
    PHONE("手机", "1"),
    PHONE_BILL("话费", "2"),
    DIGITAL_ZONE("数码专区", "3"),
    SPORTS("运动周边", "4"),
    GAME("电竞周边", "5"),
    FUEL_CARD("加油卡", "6"),
    ;
    final public String NAME;
    final public String VALUE;


    GoodsCategoryEnum(String name, String val) {
        NAME = name;
        VALUE = val;
    }

    public static List toList() {
        List<Map<String, Object>> list = new ArrayList<>();
        for (GoodsCategoryEnum goodsCategoryEnum : GoodsCategoryEnum.values()) {
            Map<String, Object> map = new HashMap<>();
            map.put("name", goodsCategoryEnum.getNAME());
            map.put("val", goodsCategoryEnum.getVALUE());
            list.add(map);
        }
        return list;
    }
}
